A pentagon is formed by cutting a triangular corner from a rectangular piece of paper. The five sides of the pentagon have lengths $13,$ $19,$ $20,$ $25$ and $31,$ in some order. Find the area of the pentagon.
Explanation: Let the sides of the pentagon be $a,$ $b,$ $c,$ $d$ and $e,$ and let $r$ and $s$ be the legs of the triangular region cut off, as shown.[asy]
size(6cm);
pair A=(0,0),B=(0,5),C=(8,5),D=(8,0),E=(8,2),F=(5.5,5);
draw(A--B--C--D--A^^E--F);
label("$c$",A--B,W);
label("$d$",B--F,N);
label("$e$",E--F,SW);
label("$a$",E--D,dir(0));
label("$b$",D--A,S);
label("$r$",F--C,N);
label("$s$",C--E,dir(0));
[/asy] By the Pythagorean theorem, $r^2+s^2=e^2.$ Furthermore, we have $r=b-d$ and $s=c-a,$ which are integers because $a,b,c,$ and $d$ are integers. Thus, $e$ must be the hypotenuse of some Pythagorean triple. The possibilities for that triple are $$\{5,12,13\},\quad\{12,16,20\},\quad\{15,20,25\},\quad\{7,24,25\}.$$Also, the leg lengths $r=b-d$ and $s=c-a$ must be among the pairwise differences of the given numbers. Since $16,$ $15$ and $24$ do not appear among any of the pairwise differences of $\{13,19,20,25,31\},$ the only possible triple is $\{5,12,13\}.$ Then we may take $r=b-d=5$ and $s=c-a=12,$ and this forces $a=19,$ $b=25,$ $c=31,$ $d=20$ and $e=13.$ Hence, the area of the pentagon is $$bc - \frac12 rs = 31 \cdot 25 -\frac 12(12\cdot 5)= 775-30=\boxed{745}.$$